using System;
using System.Reflection;
using EnvDTE;
using Microsoft.VisualStudio.VCCodeModel;

namespace DoxyComment
{

	/// <summary>
	/// Attribute is used to mark fields for persistence in custom comment
	/// providers.
	/// </summary>
	[AttributeUsage(AttributeTargets.Field)]
	public class CommentProviderPropertyAttribute : Attribute
	{
	}

	/// <summary>
	/// Attribute is used to set the friendly name for a custom comment
	/// provider. The name set with this property is displayed on the Tools
	/// Options pages for DoxyComment.
	/// </summary>
	[AttributeUsage(AttributeTargets.Class)]
	public class CommentProviderFriendlyNameAttribute : Attribute
	{
		public CommentProviderFriendlyNameAttribute(string friendlyName)
		{
			this.friendlyName = friendlyName;
		}

		public string FriendlyName
		{
			get
			{
				return friendlyName;
			}
		}

        private string friendlyName;
	}

	/// <summary>
	/// Interface is used to support custom comment providers for DoxyComment.
	/// DoxyComment uses this interface to get comment blocks for the different
	/// code element types.
	/// 
	/// To provide you own comment provider you must implement this interface in
	/// a public class.
	/// 
	/// To support options in your comment provider you must provide public
	/// properties (get and set) in your derived class.
	/// </summary>
	/// <remarks>
	/// Because DoxyComment creates an instance of your derived class through
	/// reflection you must provide a default public constructor (no
	/// parameters).
	/// 
	/// DoxyComment will automatically persist all member fields marked with the
	/// <see cref="CommentProviderProperty"/> attribute. Note that all values in
	/// the current version are passed directly to the <see cref="RegistryKey.SetValue"/>
	/// function.
	/// </remarks>
	public interface ICommentProvider
	{
		string[] CreateFileComment(Document doc,Project proj);
		string[] CreateTypeDefComment(VCCodeTypedef codeElem);
		string[] CreateUnionComment(VCCodeUnion codeElem);
		string[] CreateMacroComment(VCCodeMacro codeElem);
		string[] CreateStructComment(VCCodeStruct codeElem);
		string[] CreateNamespaceComment(VCCodeNamespace codeElem);
		string[] CreateFunctionComment(VCCodeFunction codeElem);
		string[] CreateEnumValueComment(VCCodeVariable codeElem);
		string[] CreateEnumComment(VCCodeEnum codeElem);
		string[] CreateVariableComment(VCCodeVariable codeElem);
		string[] CreateClassComment(VCCodeClass codeElem);
	}
}
